import {request} from '@umijs/max'

//员工分页查询 返回结过结构是{list：？；total：？}
export function queryStaffList(body:API.Staff_Query_Body){
    return request<API.PageInfo<API.StaffInfo>>('/staff/list',{
        method:'POST',
        data:body
    })
}

//员工新增
export function addStaff(body:API.Staff_Add_Body){
    return request<number>('/staff/add',{
        method:'POST',
        data:body
    })
}

//员工修改
export function modifyStaff(body:API.Staff_Modify_Body){
    return request<null>('/staff/update',{
        method:'POST',
        data:body
    })
}

//员工离职
export function dismissStaff(staff_id:number){
    return request<null>( `/staff/dismission/${staff_id}`)
}
//员工复职
export function reinstateStaff(staff_id:number){
    return request<null>(`/staff/reinstate/${staff_id}`);
}

//员工详情
export function getStaffDetail(staff_id:number){
    return request<API.StaffInfo>( `/staff/model/${staff_id}`)
}